package arithmetic1.tiantisai;

import java.util.Scanner;

/*
    输出沙漏
 */
public class Demo01 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String str = scanner.nextLine();
        String[] strs = str.split("[ ]");
        int count=Integer.parseInt(strs[0]);
        char c=strs[1].charAt(0);
        int arr[]=lineCount(count);
        //一个符号所处的行数
        int aLine=(arr[0]+1)/2;
        //符号最多的个数
        int maxCount=(aLine-1)*2+1;
        for(int i=1;i<=arr[0];i++){
            //该行的符号个数
            int thisCount=Math.abs(i-aLine)*2+1;
            //前后空格的个数
            int spacingCount = (maxCount - thisCount)/2;
            for(int j=0;j<spacingCount;j++){
                System.out.print(" ");
            }
            for(int j=0;j<thisCount;j++){
                System.out.print(c);
            }
            for(int j=0;j<spacingCount;j++){
                System.out.print(" ");
            }
            System.out.println();
        }
        System.out.println(count-arr[1]);
    }

    //给定符号个数，返回沙漏行数行数和用掉的符号个数
    public static int[] lineCount(int count){
        //循环次数
        int n=0;
        //用掉的符号个数
        int useCount=0;
        while (useCount+2*(2*n-1)<count){
            n++;
            if(n==1){
                useCount+=2*n-1;
            }else {
                useCount+=2*(2*n-1);
            }
        }
        return new int[]{2*n-1,useCount};
    }
}
